package com.zn.multilanguage
{

    /**
     *多国语言
     * @author zn
     *
     */
    public class MultilanguageManager
    {
        public static var _config:XML;
		
		private static var _language:String="";

        public static function initConfig(resXML:XML):void
        {
            _config = resXML;
        }

        public static function getString(resourceName:String):String
        {
            var str:String = "";
            if (_config)
            {
                var item:XML = _config.elements(resourceName)[0];
                if (item != null)
                    str = item;
            }
            else
            {
                trace("MultilanguageManager", "getString", "没有" + resourceName + "字段");
            }

            return str;
        }

		public static function get language():String
		{
			return _language;
		}

		public static function set language(value:String):void
		{
			_language = value.replace("-","_");
		}
    }
}
